<div class="pull-left setting-bar-container">
        <ul class="nav settings-bar">
			<?php foreach($options as $k=>$v):?>
			<li>	
				<?php
				$childs = array_flip(array_keys((array)$v));
				$childs[key($childs)] = 'firstkey';//FIX FOR array_filter first value
				$childs['SUB'] = ''; //REMOVE SUB CHILD
				
				if(count(array_filter( (array) $childs)) <= 0):?>
				
					<?php if(empty($v['SUB'])):?>
					<a href="#"><i class="icon-<?php echo $k;?>"></i><?php echo slugtotext($k);?></a>
					<?php else:?>
					<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion_<?php echo $k;?>" href="#sub-<?php echo $k;?>"><i class="icon-<?php echo $k;?>"></i><?php echo slugtotext($k);?></a>
					<!--Sub-menu-->
					<ul id="sub-<?php echo $k;?>" class="nav nav-stacked collapse">
						<?php foreach($v['SUB'] as $sk=>$sv) :?>
						<li>
                        	<a href="<?php echo admin_url('themes.php?page=fw_theme_options&section='.$k.'&subsection='.$sk);?>">
								<i class="icon-bullet"></i><?php echo slugtotext($sk);?>
							</a>
						</li>
						<?php endforeach;?>
					</ul>
					<?php endif;?>
					
				<?php else:?>
                	<a href="<?php echo admin_url('themes.php?page=fw_theme_options&section='.$k);?>">
                    	<i class="icon-<?php echo $k;?>"></i><?php echo slugtotext($k);?>
                    </a>
				<?php endif;?>
			</li>
			<?php endforeach;?>
        </ul><!-- Settings Bar ends -->
    </div>
<?php return;?>
<div class="sidebar">
	<div class="heading"><?php _e('Layout Settings', 'wpnukes');?></div>

	<ul class="general_settings">
		<?php foreach($options as $k=>$v):?>
		<li>	
			<?php
			$childs = array_flip(array_keys((array)$v));
			$childs[key($childs)] = 'firstkey';//FIX FOR array_filter first value
			$childs['SUB'] = ''; //REMOVE SUB CHILD
			
			if(count(array_filter( (array) $childs)) <= 0):?>
				<a href="#" class="<?php echo $k;?>"><?php echo slugtotext($k);?></a>
				
				<!--Sub-menu-->
				<?php if( ! empty($v['SUB'])):?>
				<div class="sub_menu">
					<?php foreach($v['SUB'] as $sk=>$sv) :?>
							<a href="<?php echo home_url(); ?>/wp-admin/themes.php?page=fw_theme_options&section=<?php echo $k?>&subsection=<?php echo $sk;?>"><?php echo slugtotext($sk);?></a>
				<?php endforeach;?>
				</div>
				<?php endif;?>
				
			<?php else:?>
				<a href="<?php echo home_url(); ?>/wp-admin/themes.php?page=fw_theme_options&section=<?php echo $k?>" class="<?php echo $k;?>"><?php echo slugtotext($k);?></a>
			<?php endif;?>
		</li>
        <?php endforeach;?>
	</ul>
</div>